package cn.wolfcode.trip.base.service.impl;

import cn.wolfcode.trip.base.domain.Zan;
import cn.wolfcode.trip.base.mapper.ZanMapper;
import cn.wolfcode.trip.base.service.IZanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ZanServiceImpl implements IZanService {
    @Autowired
    private ZanMapper zanMapper;

    @Override
    public Integer getZanNumByTravelId(Zan zan) {
        return zanMapper.getZanNumByTravelId(zan);
    }

    @Override
    public List<Zan> getListByUserId(Zan zan) {
        return zanMapper.getListByUserId(zan);

    }

    @Override
    public void delete(Long id) {
        zanMapper.deleteByPrimaryKey(id);
    }

    @Override
    public void save(Zan zan) {
        zanMapper.insert(zan);
    }

    @Override
    public int getZanByCommentId(Zan zan) {
        return zanMapper.getZanByCommentId(zan);
    }
}
